import type { RouteRecordStringComponent } from '@vben/types';

import { $t } from '@vben/locales';

/**
 * 该文件放非后台返回的路由 比如个人中心 等需要跳转显示的页面
 */

/**
 * 个人中心
 */
const profileRoute: RouteRecordStringComponent[] = [
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: $t('widgets.profile'),
    },
    name: 'Profile',
    path: '/',
    redirect: '/profile',
    children: [
      {
        component: '/_core/profile/index',
        meta: {
          icon: 'mingcute:profile-line',
          keepAlive: true,
          title: $t('widgets.profile'),
        },
        name: 'ProfileIndex',
        path: '/profile',
      },
    ],
  },
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: 'oss配置',
    },
    name: 'OssConfig',
    path: '/',
    redirect: '/system/oss-config',
    children: [
      {
        component: '/system/oss-config/index',
        meta: {
          activePath: '/system/oss',
          icon: 'mingcute:profile-line',
          keepAlive: true,
          title: 'oss配置',
        },
        name: 'OssConfigIndex',
        path: '/system/oss-config',
      },
    ],
  },
  // TODO: 图标要改
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: '修改生成配置',
    },
    name: 'GenConfig',
    path: '/',
    redirect: '/code-gen/edit',
    children: [
      {
        component: '/tool/gen/edit-gen',
        meta: {
          activePath: '/tool/gen',
          icon: 'mingcute:profile-line',
          keepAlive: true,
          title: '生成配置',
        },
        name: 'GenConfigIndex',
        path: '/code-gen/edit/:tableId',
      },
    ],
  },
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: '分配角色',
    },
    name: 'RoleAssign',
    path: '/',
    redirect: '/system/role-assign',
    children: [
      {
        component: '/system/role-assign/index',
        meta: {
          activePath: '/system/role',
          icon: 'mingcute:profile-line',
          keepAlive: true,
          title: '分配角色',
        },
        name: 'RoleAssignIndex',
        path: '/system/role-assign/:roleId',
      },
    ],
  },
];

/**
 * 这里放本地路由
 */
export const localMenuList: RouteRecordStringComponent[] = [
  {
    component: 'BasicLayout',
    meta: {
      icon: 'lucide:home',
      order: -1,
      title: '首页',
      hideChildrenInMenu: true,
    },
    name: 'Dashboard',
    path: '/dashboard',
    redirect: '/workspace',
    children: [
      {
        name: 'Workspace',
        path: '/workspace',
        component: '/dashboard/workspace/index',
        meta: {
          affixTab: true,
          tabClosable: false,
          icon: 'lucide:home',
          title: '首页',
        },
      },
    ],
  },
  ...profileRoute,
  // 人机交互 - 新路由
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: '年度需求预测',
    },
    name: 'HumanMachineDemand',
    path: '/',
    redirect: '/humanmachine/demand',
    children: [
      {
        component: '/man-machine/annualSales',
        meta: {
          activePath: '/humanmachine',
          icon: 'lucide:chart-line',
          keepAlive: true,
          title: '年度需求预测',
        },
        name: 'HumanMachineDemandIndex',
        path: '/humanmachine/demand',
      },
    ],
  },
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: '年度销售预测',
    },
    name: 'HumanMachineSales',
    path: '/',
    redirect: '/humanmachine/sales',
    children: [
      {
        component: '/man-machine/annualSalesForecast',
        meta: {
          activePath: '/humanmachine',
          icon: 'lucide:bar-chart',
          keepAlive: true,
          title: '年度销售预测',
        },
        name: 'HumanMachineSalesIndex',
        path: '/humanmachine/sales',
      },
    ],
  },
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: '月度销售预测',
    },
    name: 'HumanMachineMonthSales',
    path: '/',
    redirect: '/humanmachine/system/monthSales/show',
    children: [
      {
        component: '/man-machine/monthlySalesForecast',
        meta: {
          activePath: '/humanmachine',
          icon: 'lucide:chart-line',
          keepAlive: true,
          title: '月度销售预测',
        },
        name: 'HumanMachineMonthSalesShow',
        path: '/humanmachine/system/monthSales/show',
      },
    ],
  },
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: '月度销量预测',
    },
    name: 'HumanMachineMonthSalesVolume',
    path: '/',
    redirect: '/humanmachine/system/monthSalesVolume/index',
    children: [
      {
        component: '/man-machine/monthlyVolumeForecast',
        meta: {
          activePath: '/humanmachine',
          icon: 'lucide:chart-bar',
          keepAlive: true,
          title: '月度销量预测',
        },
        name: 'HumanMachineMonthSalesVolumeIndex',
        path: '/humanmachine/system/monthSalesVolume/index',
      },
    ],
  },
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: '月维度采购计划',
    },
    name: 'HumanMachineMonthPurchasePlan',
    path: '/',
    redirect: '/humanmachine/system/monthPurchasePlan/index',
    children: [
      {
        component: '/man-machine/monthlyPurchasePlan',
        meta: {
          activePath: '/humanmachine',
          icon: 'lucide:clipboard-list',
          keepAlive: true,
          title: '月维度采购计划',
        },
        name: 'HumanMachineMonthPurchasePlanIndex',
        path: '/humanmachine/system/monthPurchasePlan/index',
      },
    ],
  },
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: '周投放策略',
    },
    name: 'HumanMachineWeeklyDelivery',
    path: '/',
    redirect: '/humanmachine/system/weeklyDelivery/index',
    children: [
      {
        component: '/man-machine/weeklyPlacementStrategy',
        meta: {
          activePath: '/humanmachine',
          icon: 'lucide:calendar-days',
          keepAlive: true,
          title: '周投放策略',
        },
        name: 'HumanMachineWeeklyDeliveryIndex',
        path: '/humanmachine/system/weeklyDelivery/index',
      },
    ],
  },
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: '测试页面',
    },
    name: 'HumanMachineTest',
    path: '/',
    redirect: '/humanmachine/test',
    children: [
      {
        component: '/man-machine/test',
        meta: {
          activePath: '/humanmachine',
          icon: 'lucide:file',
          keepAlive: true,
          title: '测试页面',
        },
        name: 'HumanMachineTestIndex',
        path: '/humanmachine/test',
      },
    ],
  },
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: '智慧ai预测',
    },
    name: 'SystemChatbot',
    path: '/root_menu',
    redirect: '/root_menu/system/chatbot',
    children: [
      {
        component: '/man-machine/chatbot',
        meta: {
          activePath: '/system',
          icon: 'lucide:message-circle',
          keepAlive: true,
          title: '智慧ai预测',
        },
        name: 'SystemChatbotIndex',
        path: '/root_menu/system/chatbot',
      },
    ],
  },
  // 旧路由 - 保留但隐藏
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: '年度销售预测',
    },
    name: 'SalesForecast',
    path: '/',
    redirect: '/operate/salesForecast',
    children: [
      {
        component: '/operate/forecast/salesForecast/index',
        meta: {
          activePath: '/operate',
          icon: 'lucide:bar-chart',
          keepAlive: true,
          title: '年度销售预测',
        },
        name: 'SalesForecastIndex',
        path: '/operate/salesForecast',
      },
    ],
  },
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: '月度销售预测',
    },
    name: 'MonthSalesForecast',
    path: '/',
    redirect: '/operate/monthSalesForecast',
    children: [
      {
        component: '/operate/forecast/monthSalesForecast/index',
        meta: {
          activePath: '/operate',
          icon: 'lucide:chart-line',
          keepAlive: true,
          title: '月度销售预测',
        },
        name: 'MonthSalesForecastIndex',
        path: '/operate/monthSalesForecast',
      },
    ],
  },
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: '月度销量预测',
    },
    name: 'MonthSalesVolumeForecast',
    path: '/',
    redirect: '/operate/monthSalesVolumeForecast',
    children: [
      {
        component: '/operate/forecast/monthSalesVolumeForecast/index',
        meta: {
          activePath: '/operate',
          icon: 'lucide:chart-bar',
          keepAlive: true,
          title: '月度销量预测',
        },
        name: 'MonthSalesVolumeForecastIndex',
        path: '/operate/monthSalesVolumeForecast',
      },
    ],
  },
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: '月维度采购计划',
    },
    name: 'MonthPurchasePlan',
    path: '/',
    redirect: '/operate/monthPurchasePlan',
    children: [
      {
        component: '/operate/forecast/monthPurchasePlan/index',
        meta: {
          activePath: '/operate',
          icon: 'lucide:clipboard-list',
          keepAlive: true,
          title: '月维度采购计划',
        },
        name: 'MonthPurchasePlanIndex',
        path: '/operate/monthPurchasePlan',
      },
    ],
  },
  {
    component: 'BasicLayout',
    meta: {
      hideChildrenInMenu: true,
      hideInMenu: true,
      title: '周投放策略',
    },
    name: 'WeeklyDeliveryStrategy',
    path: '/',
    redirect: '/operate/weeklyDeliveryStrategy',
    children: [
      {
        component: '/operate/forecast/weeklyDeliveryStrategy/index',
        meta: {
          activePath: '/operate',
          icon: 'lucide:calendar-days',
          keepAlive: true,
          title: '周投放策略',
        },
        name: 'WeeklyDeliveryStrategyIndex',
        path: '/operate/weeklyDeliveryStrategy',
      },
    ],
  },
];
